package com.example.demo.mapper;

import com.example.demo.entity.school.AllData;
import com.example.demo.entity.school.SchoolProvince;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SchoolMapper {

    @Select("select count(school) as value,province as name from message group by province;")
    List<SchoolProvince> getSum();

    @Select("select count(kind) as degreeSum from message where kind='本科';")
    int degreeSum();

    @Select("select count(kind) as specialistSum from message where kind='专科';")
    int specialistSum();

    @Select("select province as name,count(school) as value from message where kind='本科' group by province order by value desc;")
    List<SchoolProvince> getEightDegreeSum();

    @Select("select province as name,count(school) as value from message where kind='专科' group by province order by value desc;")
    List<SchoolProvince> getEightSpecialistSum();

    @Select("select school,area,kind,province from message ;")
    List<AllData> lookAll();
}
